
<div style="margin-left:10px; margin-right:10px">
  <h2><?php e(r('%sitename%', __($sitename,true), __('Welcome to '.$sitename.', your local free classifieds site.',true))); ?></h2>
  <div style="border-bottom:1px solid #BEBA97; margin:3px 0 6px 0;"></div>
  <span style="color:#717171;">
    <?php e(r('%sitename%', __($sitename,true), __('Use %sitename% to buy & sell new and used goods, look for cars and pets, find local real estate, and more.',true))); ?><br />
    <?php __('Please click a link below to continue.'); ?>
  </span>
</div>
<div class="dr button_bg" style="width:150px; margin-left:10px; margin-right:10px" onclick="javascript:goto('<?php e($this->base.'/adCategories/selectCategory'); ?>');">
  <div class="button_left" style="width:14px"></div>
  <div class="dl hand" style="text-align:center; width:122px"><?php __('Post it now!'); ?></div>
  <div class="button_right" style="width:14px"></div>
</div>
<div class="clear" style="margin-bottom:5px;"></div>
<div style="border:1px solid #BEBB9C; -moz-border-radius: 0.8em; -webkit-border-radius: 0.8em; margin-left:10px; margin-right:10px; margin-top:10px">
  <div class="titlebar"><?php __('Categories'); ?></div>
  <div style="margin-bottom:20px; padding:10px 30px; background-color:#E7DEC5; border-bottom:1px solid #DAD1B9">
    <div class="dl" style="width:66%;">
      <?php echo $html->link(__('Post a classified ad',true), array('action'=>'selectCategory'), array('class'=>'bold red')); ?>
       -
      <span class="red"><?php __('quick, simple & free'); ?></span>
    </div>
    <div class="dl" style="width:33%;">
      <?php echo $html->link(__('All classified ads',true), '/adPosts', array('class'=>'bold red')); ?>
      <span class="red">(<?php __('sorted by date'); ?>)</span>
    </div>
    <div class="clear"></div>
  </div>
  <div style="padding-left:30px;">
<?php
      $count  = count($categories, COUNT_RECURSIVE);
      $column = round($count / 4);
      $i      = 0;
?>
     <div class="dl" style="width:32%;">
<?php foreach ($categories as $main=>$subcategories) { ?>
       <span class="mainCategory bold"><?php __($main); $i++; ?></span>
       <ul>
<?php     foreach ($subcategories as $id=>$category) { ?>
         <li><?php echo $html->link(__($category,true), '/adPosts/browse/'.$id); echo isset($postcount[$id])?'('.$postcount[$id].')':''; $i++; ?></li>
<?php     } ?>
       </ul>
<?php     if ($i >= $column) {
              $i = 0; ?>
     </div>
     <div class="dl" style="width:32%;">
<?php     } ?>
<?php } ?>
     </div>
     <div class="clear"></div>
  </div>
</div>

